/** 监控api */
import axios, { AxiosResponse } from "axios";
import { rtspApi } from "../utils/request";

/** 获取监控列表 */
export const getBulkget = (urls: string[]) =>
  rtspApi({
    url: "/api/rtspapi/rtsp/bulkget",
    method: "post",
    data: {
      urls,
    },
  });
/** 视频地址配置 */
export interface InRtspItem {
  name: string;
  pagePath: number;
  url: string;
}
/** 获取监控配置列表 */
export const getRtspConfig = (): Promise<AxiosResponse<{ rtspList: InRtspItem[] }>> => {
  const path = new URL("/config/rtsp.json", import.meta.url).href;
  return axios.get(path);
};
/** 获取安全天数 */
export const getSafety = () =>
  rtspApi({
    url: "/api/rtspapi/safe/safecount",
    method: "get",
  });